package com.aabte.springcloudlearn.springcloudstream.source;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.cloud.stream.messaging.Sink;
import org.springframework.cloud.stream.messaging.Source;
import org.springframework.messaging.handler.annotation.SendTo;

/**
 * @author Daniel
 */
@Slf4j
@EnableBinding(value = {Source.class})
@SpringBootApplication
public class SourceStreamApplication {

    public static void main(String[] args) {
        SpringApplication.run(SourceStreamApplication.class, args);
    }

    @StreamListener(value = Source.OUTPUT)
    public void handler(Object payload) {
        log.info("handler received: {}", payload);
    }
}
